var http = require("http");
var server = http.createServer(function(req,res){
    /*res.write("Hello World!");
    res.end();*/

    /*var body = "Hello World!";
    res.setHeader("Content-Type","text/plain");
    res.setHeader("Content-Length",body.length);
    res.end(body);*/

    var url = "http://www.baidu.com";
    var body = "<p>Redirecting to <a href='"+ url +"'> "+ url +"</a></p>";
    res.setHeader("Location",url);
    res.setHeader("Content-Type","text/html");
    res.setHeader("Content-Length",body.length);
    res.statusCode = 302;
    res.end(body);
});
server.listen(8899,"127.0.0.1");